﻿using System;
using System.Collections;
using System.Text;

namespace Petra.Gis.Geometry.Image.Tiff
{
  public partial class ImageFileDirectory
  {

    internal void checkTagParams(Tag tag, int requiredCount)
    {
      if (tag.Count != requiredCount)
        throw new InvalidFileStructureException("Tag " + tag.Id.ToString() +
          "has invalid count of data items " +
          "(count=" + tag.Count + ", should be " + requiredCount.ToString() + ").");
    }

    internal void checkTagParams(Tag tag, TagDataType requiredType, int requiredCount)
    {
      checkTagParams(tag, requiredCount);

      if(tag.Type != requiredType)
        throw new InvalidFileStructureException("Tag " + tag.Id.ToString() +
          "has invalid count of data items " +
          "(count=" + tag.Count + ", should be " + requiredCount.ToString() + ").");

    }
  }
}
